<template>
	<div class="theme">
		<van-nav-bar title="充值" left-text="返回" left-arrow @click-left="onClickLeft" />
		<div class="overlay headTop">
			<div class="overlay-content scrolling">
				<div align="center">
					<div style="padding: 30px 0px;padding-bottom: 15px;color: #EE0A24;">
						充值币种：USDT
					</div>
					<div style="border: 5px solid #43add5;width: 150px;height: 150px;" v-if="show == true">
						<van-image width="100%" height="100%" :src="qrContent" />
					</div>
					<div class="van-ellipsis" style="padding: 20px 0px;color: #999999;padding-top: 30px;width: 80%;" v-if="show == true">{{address}}</div>
					<div class="van-ellipsis" style="padding: 20px 0px;color: #999999;padding-top: 30px;width: 80%;" v-if="show == false">钱包地址生成失败</div>
				</div>
				<div style="padding: 0px 15px;padding-top: 30px;">
					充值注意事项：
					<div style="font-size: 12px;color: #999999;letter-spacing: 0.5px;padding-top: 10px;">
						请充入USDT的币种，请勿充入其他币种，否则资产将不可找回。具体规则，提醒内容还需要确定。
						<br /> 您充币至上述地址后，需要整个网络节点的确认，最快15次网络确认后到账，30次网络确实后可提币。
						<br /> 您的充币地址不会经常发生改变，可以重复充币，如有更改，我们会尽量通过网站公告或者邮件通知您。如有疑问，请联系客服。
					</div>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
	let _this;
	export default {
		name: 'Recharge',
		components: {},
		props: {},
		data() {
			return {
				img: '',
				show: false,
				coin: [],
				address: '',
				qrContent: '',
			};
		},
		beforeCreate() {
			_this = this;
		},
		watch: {},
		computed: {},
		methods: {
			onClickLeft() {
				this.$router.push({
					path: '/Mine'
				});
			},
			getCoin() { // 获取 USDT 的钱包地址
				this.axios.get(process.env.API_HOST + 'user/transfer/into/1').then(res => {
					if(res.data.code == 200) {
						this.coin = res.data.data;
						this.show = true;
						this.address = res.data.data.address;
						this.qrContent = res.data.data.qrContent;
					} else if(res.data.code == 500) {
						this.show = false;
					}
				})
			}
		},
		created() {},
		mounted() {
			this.getCoin();
		},
		destroyed() {

		},
		filters: {}
	};
</script>

<style lang="less" scoped>
	/deep/ .van-nav-bar {
		background-color: #43add5;
	}
	
	/deep/ .van-nav-bar .van-icon {
		color: white;
	}
	
	/deep/ .van-nav-bar__title {
		color: white;
	}
	
	/deep/ .van-nav-bar__arrow {
		font-size: 18px;
	}
	
	/deep/ .van-nav-bar__text {
		color: white;
	}
</style>